package com.webdemo12.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.webdemo12.dao.UserDao;
import com.webdemo12.pojo.User;
import com.webdemo12.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {
	@Resource
	UserDao userDao;
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}
	@Override
	public void deleteUser(User user) {
		userDao.deleteUser(user);
	}
	@Override
	public void updateUser(User user) {
		userDao.updateUser(user);
	}
	@Override
	public User getUser(int id) {
		User user = userDao.getUser(id);
		return user;
	}
	@Override
	public List<User> getUsers() {
		List<User> users = userDao.getUsers();
		return users;
	}
	@Override
	public User getUser(String name) {
		User user = userDao.getUser(name);
		return user;
	}
}
